import os
import unittest
from HTMLTestRunner import HTMLTestRunner

report_dir = "./bg/"
report_file = report_dir + "html_bg.html"

if not os.path.exists(report_dir):
    os.mkdir(report_dir)

with open(report_file, "wb") as fl:
    dir = "./"
    suite = unittest.defaultTestLoader.discover(dir,"test_login.py")
    runner = HTMLTestRunner(title='test_baidu', description='', stream=fl)
    runner.run(suite)
